﻿<UserControl x:Class="Bewise.Phone.DynamicCalendar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:my="clr-namespace:Bewise.Phone" mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    <UserControl.Resources>
        <my:Tools x:Key="Tools"/>

        <Style x:Key="ButtonStyle" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Duration="0:0:0.1" To="0.6" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="circle"/>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Image x:Name="circle" Opacity="0" Source="{Binding Source={StaticResource Tools}, Path=CircleImage}" HorizontalAlignment="Right" VerticalAlignment="Top" ></Image>
                            <ContentPresenter HorizontalAlignment="Right" VerticalAlignment="Top"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="ContentPanel" VerticalAlignment="Top" Margin="10,0,10,0" Height="400">
        <Grid x:Name="dateGrid" Margin="0,0,0,10" Height="Auto" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TextBlock Margin="0,15,0,0" Name="itemDisplayDate" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="{StaticResource PhoneFontSizeMedium}" MouseLeftButtonUp="itemDisplayDate_MouseLeftButtonUp"></TextBlock>
            <Button Grid.Column="1" x:Name="editDate" Style="{StaticResource ButtonStyle}" Click="editDate_Click" Height="64" Width="64">
                <Image Source="{Binding Source={StaticResource Tools}, Path=EditImage}" ></Image>
            </Button>
        </Grid>
    </Grid>
</UserControl>
